package cn.kgc.jdbc.controller;

import cn.kgc.jdbc.entity.Student;
import cn.kgc.jdbc.service.StudentService;
import cn.kgc.jdbc.service.StudentServiceImpl;

import java.util.List;

/**
 *  学生请求的控制层
 */
public class StudentController {

    private StudentService studentService = new StudentServiceImpl();

    //添加
    public boolean addStudent(String name){

          return studentService.addStudent(name);

    }

    //删除
    public boolean delStudent(int id){

        return studentService.delStudent(id);

    }


    //  分班 更新
    public boolean divideClazz(int stuNo,String clazzName){
        return studentService.divideClazz(stuNo,clazzName);
    }


    //查询所有学生信息  并显示班级的名称

    public List<Student> selectAll(){
        return studentService.selectAll();
    }


}
